package com.automannn.cloud.practice.nacosConfig;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ConfigurableApplicationContext;

/**
 * @author automannn
 * @Date 2022/2/17
 */
@SpringBootApplication
/*xxx: spring-cloud-context项目，已经将BootstrapApplicationListener工厂自动进行了注册，通常情况下，引入该项目自动开启该功能*/
/*xxx: nacos的配置通过 PropertySourceLocator实现，具体的加载配置的过程，则由 nacos-clint实现 */
public class NacosClientApp {

    public static void main(String[] args) {
        SpringApplication application = new SpringApplication(NacosClientApp.class);
        ConfigurableApplicationContext applicationContext= application.run(args);

        System.out.println(applicationContext.getEnvironment().getProperty("cloudName"));
        System.out.println(applicationContext.getEnvironment().getProperty("myName"));
        System.out.println(applicationContext.getEnvironment().getProperty("atm.user.name"));
    }

}
